import frappe
import os
from zy_packlist.utils import uploadFileManagerFolder

def set_defaults():
    # doc=frappe.get_doc('DocType','Item')
    # doc.quick_entry=0
    # doc.save()
    frappe.db.set_value('DocType', 'Item', 'quick_entry', 0)

    if not frappe.db.exists("Item Group", 'goods'):
        doc=frappe.new_doc('Item Group')
        doc.item_group_name='goods'
        doc.save()
    
    frappe.db.set_single_value("Stock Settings",'item_group','goods')

    current_dir = os.path.dirname(os.path.abspath(__file__))
    
    template_file = os.path.join(current_dir, '', 'PackListTemplateFile.xlsx')

    uploadFileManagerFolder('PackListTemplateFile.xlsx',template_file)



